home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 12-07.C < prev    next >
Text File  |  1991-05-06  |  827b  |  41 lines

  1. main()
  2. {
  3.    int old_mode;
  4.    int buttons, count;
  5.    int x, y;
  6.    char string[25];
  7.  
  8.    old_mode = fg_getmode();
  9.    fg_setmode(fg_automode());
  10.  
  11.    if (fg_mouseini() < 0) {
  12.       fg_setmode(old_mode);
  13.       fg_reset();
  14.       exit();
  15.       }
  16.  
  17.    fg_setcolor(15);
  18.    fg_rect(0,fg_getmaxx(),0,fg_getmaxy());
  19.  
  20.    fg_mousevis(1);
  21.    count = 0;
  22.  
  23.    while (count == 0) {
  24.       fg_waitfor(54);
  25.       fg_mousebut(1,&count,&x,&y);
  26.       fg_mousepos(&x,&y,&buttons);
  27.       sprintf(string,"X=%3d  Y=%3d  count=%4d",x,y,count);
  28.       fg_mousevis(0);
  29.       fg_setcolor(15);
  30.       fg_rect(0,fg_xconvert(25),0,fg_yconvert(1));
  31.       fg_setcolor(0);
  32.       fg_locate(0,0);
  33.       fg_text(string,24);
  34.       fg_mousevis(1);
  35.       fg_mousebut(2,&count,&x,&y);
  36.       }
  37.  
  38.    fg_setmode(old_mode);
  39.    fg_reset();
  40. }
  41.